chore: upgrade storybook to latest version (#733)#734
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the Storybook configuration from version 8.6.4 with Webpack-based @storybook/nextjs to version 10.1.7 with Vite-based @storybook/nextjs-vite. The migration simplifies the build setup, improves performance, and modernizes the project's Storybook integration.
Key changes include:
- Upgrading all Storybook packages from v8.6.4 to v10.1.7 and switching to Vite-based packages
- Updating ~70 story files to import types from
@storybook/nextjs-viteinstead of@storybook/react - Changing test utility imports from
@storybook/testand@storybook/addon-actionsto the newstorybook/testandstorybook/actionspaths - Simplifying the Storybook main configuration by removing custom webpack aliasing
- Changing TypeScript's moduleResolution from "node" to "bundler" to better support Vite
Reviewed changes
Copilot reviewed 81 out of 84 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
.storybook/main.ts |
Completely rewritten to use Vite-based configuration with defineMain, removing webpack-specific customizations |
package.json |
Updated all Storybook dependencies to v10.1.7, consolidated multiple addon packages into the main Vite package |
tsconfig.json |
Changed moduleResolution from "node" to "bundler" for better Vite compatibility |
jest.config.js |
Removed moduleNameMapper for @storybook/addon-actions as the mock is no longer needed |
src/mocks/@storybook/addon-actions.ts |
Removed mock file as part of migration to new import paths |
| Story files (70+ files) | Updated all Meta and StoryObj imports from @storybook/react to @storybook/nextjs-vite |
| Args files (7 files) | Updated fn import from @storybook/test to storybook/test |
| Test files | Updated waitFor import in test file from @storybook/test to storybook/test |
| Storybook utility files | Updated Preview and type imports in decorators, parameters, and controls files |
| Data Dictionary filters story | Updated action import from @storybook/addon-actions to storybook/actions |
src/utils/mdx/staticGeneration/staticProps.ts |
Changed SerializeOptions type import to use Parameters utility type |
src/hooks/authentication/session/useSessionIdleTimer.ts |
Consolidated type import with named import using inline type keyword |
| Column filter tag story | Added explicit Column type import and cast for BIONETWORK constant |
| FilterTag args | Fixed LOREM_IPSUM import to use correct relative path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #733.
This pull request migrates the Storybook configuration and related dependencies from the Webpack-based
@storybook/nextjssetup to the new Vite-based@storybook/nextjs-vitesystem. It updates all relevant Storybook packages, adjusts imports throughout the codebase, and simplifies the Storybook config file. These changes modernize the project's Storybook integration, improve performance, and ensure compatibility with the latest Storybook ecosystem.Storybook migration and configuration updates:
.storybook/main.tsto use@storybook/nextjs-viteand Vite builder, replacing the previous Webpack-based setup and removing custom aliasing and docgen options.package.jsonto their Vite-compatible versions, including switching from@storybook/nextjsand related packages to@storybook/nextjs-vite. [1] [2]Codebase-wide import adjustments:
MetaandStoryObjfrom@storybook/nextjs-viteinstead of@storybook/react, ensuring compatibility with the new Storybook setup. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]Test utility import updates:
fnandactionutility functions in stories and args files to use the newstorybook/testandstorybook/actionspackages, replacing the previous@storybook/testand@storybook/addon-actionsimports. [1] [2] [3] [4] [5] [6]Miscellaneous import fixes:
LOREM_IPSUMinFilterTagstory args to use a relative path, ensuring it resolves correctly after the migration.